package cn.myschool.java79.test1;

import cn.myschool.java79.dao.ExamResultMapper;
import cn.myschool.java79.entity.ExamResult;
import cn.myschool.java79.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

/**
 * @author oldliu
 * @since 1.0
 */
public class ExamTest1 {
    public static void main(String[] args) {
        SqlSession s= MybatisUtil.get();

        try {
            ExamResultMapper mapper = s.getMapper(ExamResultMapper.class);
//            mapper.findAll().forEach(System.out::println);
            ExamResult examResult = mapper.get(14L);
            System.out.println(examResult);
            System.out.println(examResult.getSubject());
            System.out.println(examResult.getStudent());
        }finally {
            MybatisUtil.close(s);
        }

    }
}
